var express = require('express')
var bodyParser = require('body-parser')

//导入路由模块
var router = require('./router')
var app = express()

//开放文件
app.use('/node_modules/', express.static('./node_modules/'))
app.use('/public/', express.static('./public/'))

//配置模板对象和post请求处理
app.engine('html', require('express-art-template'))
app.use(bodyParser.urlencoded({ extended: false }))


//将路由挂载到App上
app.use(router)

app.listen(3000, function() {
    console.log('crud-express app is runing...')
})